Fix multi-asic behaviour for queuestat #3554
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did
This is in accordance to the issue sonic-net/sonic-buildimage#15148 which tracks the multi-asic support for scripts in sonic-utilities.
How I did it
Modified the queuestat script and associated test files.
How to verify it
The changes were verified by:
Previous command output (if the output of a command-line utility has changed)
Cmd:
queuestat
Result: Empty
Reason: When the namespace (
-n
/--namespace
) argument is not specified on a multi asic device the scripts will return nothing.New command output (if the output of a command-line utility has changed)
Cmd:
queuestat
Result: Runs on all asics present on the device.
Reason: To be consistent with the other PRs in #15148, we iterate over all namespaces when none is specified on a multi-asic device.
Test snapshots provided below:
Specifying invalid namespace on single asic devices:
queuestat -n asic0
Single asic behaviour is preserved:
queuestat -p Ethernet152
Multi asic behaviour when namespace is specified:
queuestat -n asic1 -p Ethernet-Rec1
Multi asic behaviour when no namespace is specified:
queuestat
.
.
.
.
.
.